﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using Components;
using System.Collections;
using Base;
using System.Drawing;

namespace Core.Component
{
    [Serializable()]
    public class UIComponent: IBindingControl, ISGVControl
    {
        public UIComponent()
        {
            strType = String.Empty;
            lstChilds = new List<UIComponent>();
        }

        [NonSerialized()]
        public UIComponent Parent;

        public Core.Component.UIComponent component
        {
            set;
            get;
        }

        public String strType;
        public String Name;
        public Object Value;
        public Size Size;
        public Point Location;
        public Color BackColor;
        public Color ForeColor;
        public String FontName;
        public FontStyle FontStyle;
        public float FontSize;
        public DockStyle Dock;
        public bool ReadOnly;

        public List<UIComponent> lstChilds;

        #region ISGVControl
        public string SGVTag
        {
            set;
            get;
        }

        public string SGVShortcutString
        {
            set;
            get;
        } 
        #endregion

        public void RegisterModule(Base.BaseModule module)
        {
           
        }

        public void UpdateFormat()
        {
            
        }

        #region IBindingControl
        public void Init()
        {

        }

        public string BindingTable
        {
            set;
            get;
        }

        public string BindingColumn
        {
            set;
            get;
        }

        public string DataSourceTable
        {
            set;
            get;
        }

        public string DataSourceDisplayColumn
        {
            set;
            get;
        }

        public string DataSourceKeyColumn
        {
            set;
            get;
        }

        public string DataSourceColumns
        {
            set;
            get;
        }

        public string BindingPropertyName
        {
            set;
            get;
        } 
        #endregion

        public UIComponent Serialize()
        {
            return new UIComponent();
        }

        public void Deserialize(UIComponent component)
        {
            
        }
    }
}
